home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 481a.lha / AMIGA C MANUAL_v2.00 / CMAN2.LZH / HintsAndTips / Example1.c < prev    next >
C/C++ Source or Header  |  1991-01-27  |  1KB  |  45 lines

  1. /* Example 1                                               */
  2. /* This example tell you if you have an American (NTSC) or */
  3. /* European (PAL) system.                                  */ 
  4.  
  5.  
  6. /* Declares commonly used data types, such as UWORD etc: */
  7. #include <exec/types.h>
  8.  
  9. /* This header file declares the GfxBase structure: */
  10. #include <graphics/gfxbase.h>
  11.  
  12.  
  13. /* Pointer to the GfxBase structure. NOTE! This pointer must */
  14. /* allways be called "GfxBase"!                              */
  15. struct GfxBase *GfxBase;
  16.  
  17.  
  18. main()
  19. {
  20.   int loop;
  21.   
  22.   /* Open the Graphics Library: (any version) */
  23.   GfxBase = (struct GfxBase *)
  24.     OpenLibrary( "graphics.library", 0 );
  25.  
  26.   if( !GfxBase )
  27.     exit(); /* ERROR! Could not open the Graphics Library! */
  28.  
  29.  
  30.   if( GfxBase->DisplayFlags & NTSC )
  31.     printf( "You have an American (NTSC) Amiga.\n" );
  32.  
  33.   if( GfxBase->DisplayFlags & PAL )
  34.     printf( "You have an European (PAL) Amiga.\n" );
  35.  
  36.  
  37.   /* Close the Graphics Library: */
  38.   CloseLibrary( GfxBase );
  39.  
  40.  
  41.   /* Wait for a while: */
  42.   for( loop = 0; loop < 500000; loop++ )
  43.     ;
  44. }
  45.